# from rest_framework.decorators import action
#
# from dvadmin.system.models import ActivityPopularize
# from dvadmin.utils.json_response import DetailResponse
# from dvadmin.utils.serializers import CustomModelSerializer
# from dvadmin.utils.viewset import CustomModelViewSet
#
#
# class ActivityPopularizeSerializer(CustomModelSerializer):
#     """
#     活动管理接口-序列化器
#     """
#
#     class Meta:
#         model = ActivityPopularize
#         fields = "__all__"
#         read_only_fields = ["id"]
#
#
# class ActivityPopularizeCreateUpdateSerializer(CustomModelSerializer):
#     """
#     活动管理接口 创建/更新时的列化器
#     """
#
#     def validate(self, attrs: dict):
#         return super().validate(attrs)
#
#     class Meta:
#         model = ActivityPopularize
#         fields = '__all__'
#
#
# class ActivityPopularizeViewSet(CustomModelViewSet):
#     """
#     活动管理接口
#     list:查询
#     create:新增
#     update:修改
#     retrieve:单例
#     destroy:删除
#     """
#     queryset = ActivityPopularize.objects.all()
#     serializer_class = ActivityPopularizeSerializer
#
#     @action(methods=['GET'], detail=True)
#     def role_get_menu(self, request):
#         app_user_queryset = ActivityPopularize.objects.filter(users__id=request.user.id).values_list('data_range', flat=True)
#         return DetailResponse(data=app_user_queryset)
